package uk.ac.aber.Blockmation;

import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import uk.ac.aber.Blockmation.ColorsTable.ColorsTable;

public class RightPanel extends JPanel {
	
	private MainFrame mainFrame;
	
	RightPanel(MainFrame mainFrame){
            
            this.mainFrame = mainFrame;
            ///this.setBackground(Color.red);
            this.setPreferredSize(new Dimension(2, 22));
            ColorsTable table = mainFrame.getMyTable();
            JPanel panel = new JPanel(new GridLayout(1,0));
            panel.add(table);
            panel.setOpaque(true);

            //Create the scroll pane and add the this to it.
            JScrollPane scrollPane = new JScrollPane(panel);
            //Add the scroll pane to this panel.
            add(scrollPane);

            ///this.setLayout(new GridBagLayout());
            this.setBorder(BorderFactory.createTitledBorder("Colour Panel"));

            this.setVisible(true);

    	}
}